<div class="properties-grid">
	<div class="row"><?php foreach ($projects as $listing) { ?> <?php 
	//get media for listing
	$media = $this->mdl_projectsmodel->get_media_v2($listing['ID'], "Cover,Gallery", 1);
	if(isset($media->FileName) && isset($media->FileExtension)) {
		//$image = $this->imagemodel->resize($media->FileName . $media->FileExtension, IMAGE_WIDTH, IMAGE_HEIGHT, HTTP_PROJECT_DIRECTORY_IMAGE . $listing['ID'] . '/', $this->config->item('HTTP_PRODIR_MEDIA_IMAGE') . $listing['ID'] . '/');
		$image = $this->config->item('HTTP_PRODIR_MEDIA_IMAGE') . $listing['ID'] . '/' . $media->FileName . '-270x200' . $media->FileExtension;
	} else {
		$image = $this->config->item('HTTP_IMAGE') . 'tmp/no-image.png';
	}
	 
	?>
	<div class="property span3">
	<div class="image">
	<div class="content">
		<a href="<?php echo base_url(); ?>project-detail/<?php echo $listing['Link']; ?>"><img src="<?php echo $image; ?>" alt=""></a> 
	</div>
	<!-- /.content -->
	<!-- <div class="price"><?php //echo $listing['PropertyType']; ?>
	</div>
	-->
	</div>
	<!-- /.image -->
	<div class="title">
	<h2><a href="<?php echo base_url(); ?>project-detail/<?php echo $listing['Link']; ?>"> <?php echo html_entity_decode(character_limiter(ucwords(strtolower($listing['ProjectName'])), 16) , ENT_QUOTES, 'UTF-8'); ?></a></h2>
	</div>
	<!-- /.title -->
	<div class="location"><?php
	//Locality
	//initiation
	$locality = "";
	//check subarea
	if (!empty($listing['Subarea'])) {
		$locality .= $listing['Subarea'] . ", ";
	}
	
	//check location
	if (!empty($listing['Location'])) {
		$locality .= $listing['Location'] . ", ";
	}
	
	//check city
	if (!empty($listing['City'])) {
		$locality .= $listing['City'];
	}
	
	if (!empty($locality)) {
		echo character_limiter($locality, 30);
	}
	?></div>
	<!-- /.location -->
	<div class="area"><span class="key">Area:</span><!-- /.key --> <span
		class="value"><?php echo number_format($listing['Size_Min']) . ' ' . strtolower($listing['SizeUnit']); ?></span><!-- /.value -->
	<span class="">to</span><!-- /.key --> <span class="value"><?php echo number_format($listing['Size_Max']). ' ' . strtolower($listing['SizeUnit']); ?></span><!-- /.value -->
	</div>
	<!-- /.area -->
	<div class="clearfix"></div>
	</div>
	<!-- /.property --> <?php } ?>
	</div>
<!-- /.row -->
</div>
<!-- /.properties-grid -->
